package JUC.CountDownLatch和cyclicBarrier和Semaphore的使用;

import lombok.Getter;

/**
 * @author CKC
 * @DateTime 2021/3/31 19:27
 */
public enum CountEnum {
    ONE(1,"齐"),TWO(2,"楚"),THREE(3,"燕"),FOUR(4,"赵"),FIVE(5,"魏"),SIX(6,"韩");

    @Getter private Integer retCode;
    @Getter private String retMessage;
    
    CountEnum(Integer retCode, String retMessage) {
        this.retCode = retCode;
        this.retMessage = retMessage;
    }
    
    public static CountEnum forEach_CountTryEnum(int index){
    
        CountEnum[] values = CountEnum.values();
        for (CountEnum element: values) {
            if (index==element.getRetCode()){
                return element;
            }
        }
        return null;
    }
}
